package com.zq.assistant.ui.settings;

import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;

import com.zq.assistant.R;

/**
 * Created by zhangqiang on 17-6-29.
 */

public class SettingsFragment extends PreferenceFragment {

    private EditTextPreference editServerAddressPreference;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.settings);

        editServerAddressPreference = (EditTextPreference) findPreference(getResources().getString(R.string.server_address));
        editServerAddressPreference.setSummary(PreferenceManager.getDefaultSharedPreferences(getActivity()).getString(getString(R.string.server_address),""));
    }
}
